package comment.dao.imp;

import comment.dao.IUserDao;
import comment.model.pojo.User;
import comment.until.JdbcTemplate;

public class UserDaoImp implements IUserDao {
    @Override
    public User getUserById(int id) {
        try {
            return (User) JdbcTemplate.executeDQL(User.class,"select * from t_user where id=?",id).get(0);
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        }

    return null;
    }

}
